/**
 * 判断data是否是对象
 * @param data
 * @returns
 */
export const isObject = (data: any) => {
  return data !== null && typeof data === "object";
};

/**
 * 判断新旧两值是否相等
 * @param oldValue
 * @param newValue
 * @returns
 */
export const hasChanged = (oldValue: any, newValue: any) => {
  return !Object.is(oldValue, newValue);
};

/**
 * 被收集器收集的操作类型
 */
export const TrackOpTypes = {
  GET: "get",
  HAS: "has",
  ITERATE: "iterate",
};

/**
 * 被触发器触发的操作类型
 */
export const TriggerOpTypes = {
  SET: "set",
  ADD: "add",
  DELETE: "delete",
};

/** 属性名，属性值为原始对象 */
export const RAW = Symbol("raw");

/** 定义一个接口来表示带有 RAW 属性的代理对象 */
export interface ProxyArrayWithRaw extends Array<any> {
  [RAW]: Array<any>;
}
